#!/bin/sh
#
#Author:Bruno
#
#This installation will make modifications to the software stack on your device. 
#
#This installer and the Channl.TV software are made for demonstration purpose only 
#and provided on an 'as is' basis.                                                
#
#The author(s) assumes no responsibility or liability for any damage, direct or    
#indirect claims as a result of using this installer and or related application(s)
#and or related services.                                                          
#
#USE AT YOUR OWN RISK !                          
#
#parameters $1:temp dir, $2:appliance app dir $3:pid
#20071012
#Make the root file system writable (if needed)
sudo mount -uw /
#Unpack the tar file
cd $1
tar -xvf Channltv.frappliance.tar 
#First handle the InstallerExtras
#Update Perian
rm -Rf /Library/QuickTime/Perian.component
mv Channltv.frappliance/InstallerExtras/Perian.component /Library/QuickTime/Perian.component
#Remove the extra's from the appliance 
rm -Rf Channltv.frappliance/InstallerExtras 
#Replace the old appliance by the new one 
rm -Rf $2
mv Channltv.frappliance $2
#Restart the finder
kill -9 $3
#sometimes the Finder does not automatically restart
open /System/Library/CoreServices/Finder.app
#remove old files
rm -Rf *
#back
cd ~